export default {
	getUserInfo(state) {
		let userInfo = {};
		if(state.userInfo) {
			userInfo = state.userInfo || {};
		} else {
			userInfo = uni.getStorageSync('open') || {}
		}
		return userInfo
	},
	getUser(){
		let user={}
		user=uni.getStorageSync("open")
		return user
	}
	,
	getCartGoodsChecked:(state) => (goodsID) => {//获取购物车该商品选择状态
		let cartGoodsList = state.cartGoodsList || [];
		if (cartGoodsList.findIndex(item=>item.id == goodsID)<0) return 0;
		else return cartGoodsList.find(item=>item.id == goodsID).checked;
	}
}
